<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
        xmlns:icecore="http://www.icefaces.org/icefaces/core"
       xmlns:ace="http://www.icefaces.org/icefaces/components"
       xmlns:ice="http://www.icesoft.com/icefaces/component"
       xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title><h:form><h:outputText>Abgaben browsen</h:outputText></h:form></title>
    </h:head>
    <h:body>
        <ui:composition template="WEB-INF/templates/lecture.xhtml">
            <ui:define name="content">
                <h:form>
                    <ice:outputText value="Blatt" />
                    <ice:selectOneMenu value="#{browseHandingIn.sheet}"
                                       partialSubmit="true">
                        <f:converter converterId="exerciseSheetConverter" />
                        <f:selectItems value="#{browseHandingIn.sheets}" />
                    </ice:selectOneMenu>
                    <br />
                </h:form>
                <h:form>    
                    <ice:outputText value="Abgabe" />
                    <ice:selectOneMenu value="#{browseHandingIn.handingIn}"
                                       partialSubmit="true">
                        <f:selectItems value="#{browseHandingIn.handingIns}" />
                        <f:converter converterId="handingInConverter" />
                    </ice:selectOneMenu>
                    <br />
                </h:form>    
                <h:form>        
                    <ice:outputText value="Übungsgruppe" />
                    <ice:selectOneMenu value="#{browseHandingIn.exerciseGroup}"
                                       partialSubmit="true">
                        <f:selectItems value="#{browseHandingIn.exerciseGroups}" />
                        <f:converter converterId="exerciseGroupConverter" />
                    </ice:selectOneMenu>
                    <br />
                </h:form>    
                <h:form>    
                    <ice:outputText value="Student" />
                    <ice:selectOneMenu value="#{browseHandingIn.user}"
                                       partialSubmit="true">
                        <f:selectItems value="#{browseHandingIn.users}" />
                        <f:converter converterId="userConverter" />
                    </ice:selectOneMenu>
                </h:form>
                <br />
                <h:form>
                    <ice:commandButton value="aktualisieren"
                                       action="#{browseHandingIn.doAction()}" />
                </h:form>
                
                <ice:dataTable value="#{browseHandingIn.files}"
                               var="row">
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Blatt" /></f:facet>
                        <ice:outputText value="#{row.sheet}" />
                    </ice:column>
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Abgabe" /></f:facet>
                        <ice:outputText value="#{row.handingIn}" />
                    </ice:column>
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Übungsgruppe" /></f:facet>
                        <ice:outputText value="#{row.exerciseGroup}" />
                    </ice:column>
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Student" /></f:facet>
                        <ice:outputText value="#{row.student}" />
                    </ice:column>
                    <ice:column>
                        <f:facet name="header"><ice:outputText value="Datei" /></f:facet>
                        <ice:outputResource resource="#{row.file}" />
                    </ice:column>
                </ice:dataTable>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
